var data = [
    { "progress": "60", "Status": "已完成" },
    { "progress": "30", "Status": "进行中" },
    { "progress": "20", "Status": "待执行" }
];

// 用户ID
let id = getUrlParam("id");
$(function () {
    GetUserRole();
});
//获取用户权限
function GetUserRole() {
    // let thisdata = [];
    // thisdata.push(InitRole(id));
    let USERdata = InitRole(id);
    if (USERdata != null) {
        InitData();

    }
    else OpenErrmsg("../../web/errhtml/404.html");
}
function InitData() {
    $('#dg_WorkPlanList').datagrid({
        data: data
    });
}
function formaterimg(value, row) {
    let imgname = "";
    if (row.Status == "已完成") imgname = "finish";
    if (row.Status == "进行中") imgname = "2";
    if (row.Status == "待执行") imgname = "3";
    let str = '<img style="width: 30px;height: 30px;margin-right: 00px;" src="../../img/' + imgname + '.png" />';
    return str;
}
function formaterStatus(value, row) {
    let str = ' <div style="">' + value + '</div>'
    return str;
}
function formaterProgress(value, row) {
    //进度在后台算好 百分比
    let progress = value;
    let text = "";
    if (value > 10) text = value + "%";
    return "<div class='proparent'><div class='prochild' style='width:" + progress + "%;'>" + text + "</div></div>"
}
